package com.midian.action.mc.advice;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.midian.action.mc.common.AjaxAction;
import com.midian.common.annotation.FunctionAnnotationOverride;
import com.midian.common.exception.BizException;
import com.midian.model.advice.Advice;
import com.midian.model.user.User;
import com.midian.service.advice.IAdviceService;
import com.midian.service.user.IUserService;

/**
 * 建议表Action
 * @author Mengfh
 *
 */
@Scope("prototype")
@Controller("adviceAction")
@FunctionAnnotationOverride(isAction = true, auth = "反馈管理")
public class AdviceAction extends AjaxAction<Advice> {
	/**建议表实体*/
	private Advice entity;
	/**建议表实体列表*/
	private List<Advice> rows;
	/**建议表业务*/
	private IAdviceService adviceService;
	/**用户业务*/
	private IUserService userService;
//	/**用户列集合*/
//	private List<User> userList;
//	
//	public List<User> getUserList() {
//		return userList;
//	}
//	public void setUserList(List<User> userList) {
//		this.userList = userList;
//	}
	@Resource(name="userService")
	public void setUserService(IUserService userService) {
		this.userService = userService;
	}
	public Advice getEntity() {
		return entity;
	}
	public void setEntity(Advice entity) {
		this.entity = entity;
	}
	@Resource(name = "adviceService")
	public void setAdviceService(IAdviceService adviceService) {
		this.service = adviceService;
		this.adviceService = adviceService;
	}
	@Override
	protected Advice dytEntity() {
		if(this.entity == null) {
			this.entity = new Advice();
		}
		return getEntity();
	}
	@Override
	protected void dyEntity(Advice t) {
		setEntity(t);
	}
	@Override
	public void setRows(List<Advice> rows) {
		this.rows = rows;
	}
	@Override
	public List<Advice> getRows() {
		return rows;
	}
	
//	@Override
//	public String ajax() {
//		try {
//			userList= this.userService.getUsers();
//		} catch (BizException e) {
//			e.printStackTrace();
//		}
//		return super.ajax();
//	}
	
//	@Override
//	public String showInfo() {
//		try {
//			userList = this.userService.getUsers();
//		} catch (BizException e) {
//			e.printStackTrace();
//		}
//		return super.showInfo();
//		
//	}
	
}
